# coding: utf-8


class AlaError(Exception):
    line_number = None

    def __init__(self, message, line_number=None):
        self.message = message
        self.line_number = line_number

    def __str__(self):
        return self.message


# Scanner errors

class AlaGeneralLexicalError(AlaError):
    pass


class AlaUnknownTokenError(AlaGeneralLexicalError):
    pass


# Parser errors

class AlaGeneralSyntaxError(AlaError):
    pass


class AlaGrammarTableError(AlaGeneralSyntaxError):
    pass


class AlaParserError(AlaGeneralSyntaxError):
    pass


# Semantic analyzer errors

class AlaGeneralSemanticError(AlaError):
    pass


class AlaTypeCheckerError(AlaGeneralSemanticError):
    pass


class AlaTypeError(AlaGeneralSemanticError):
    pass


class AlaBuiltinRedefineError(AlaGeneralSemanticError):
    pass


class AlaBuiltinFunArgumentsError(AlaGeneralSemanticError):
    pass


# Code Generator errors

class AlaCodeGeneratorException(AlaError):
    pass


class AlaNotImplementedException(AlaError):
    pass


class AlaFunctionException(AlaError):
    pass